<?php /*a:3:{s:66:"D:\projects\original_admin\app\merchant\view\store\store_info.html";i:1754814710;s:61:"D:\projects\original_admin\app\merchant\view\common\base.html";i:1752764603;s:63:"D:\projects\original_admin\app\merchant\view\common\header.html";i:1754830154;}*/ ?>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
	<meta charset="UTF-8" />
	<meta name="renderer" content="webkit" />
	<meta name="force-rendering" content="webkit" />
	<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>管理系统</title>
	<script src="/static/merchant/js/jquery-min.js"></script>
	<link rel="stylesheet" href="/static/merchant/layui/css/layui.css">
	<script type="text/javascript" src="/static/merchant/layui/layui.js"></script>
	<link rel="stylesheet/less" type="text/css" href="/static/merchant/css/index.less" />
	<script src="/static/merchant/js/less.js"></script>
    
</head>
<body>
	<main class="CenterMain">
		<header class="Header">
    <div class="logo img_box">
        <img src="/static/merchant/images/logow.png">

    </div>
    <div class="top">
        <ul class="nav-buttons">
            <li id="toggle-btn">

                <span class="desktop-text layui-icon layui-icon-spread-left">
                </span>
                <span class="mobile-text">菜单</span>
            </li>
        </ul>
        <dl class="menu-btn">
            <a class="img_box ">
                <img src="/static/merchant/images/head1.png">
                <i class="msg"></i>
            </a>
            <a class="img_box">
                <img src="/static/merchant/images/head2.png">
            </a>
        </dl>
        <span class="hr"></span>
        <ul class="layui-nav">

            <li class="layui-nav-item" lay-unselect>
                <a href="javascript:;">
                    <img  src="<?php echo htmlentities((string) (isset($userInfo['shop_thumb']) && ($userInfo['shop_thumb'] !== '')?$userInfo['shop_thumb']:'/static/merchant/images/sign-user.png')); ?>" class="layui-nav-img">
                    <span><?php echo htmlentities((string) $userInfo['shop_name']); ?></span>
                </a>
                <dl class="layui-nav-child">
                    <!-- <dd><a href="account_info.html">个人信息</a></dd> -->
                    <dd><a href="/merchant/account_pwd.html">密码修改</a></dd>
                    <dd style="text-align: center;"><a href="/merchant/login_out">退出</a></dd>
                </dl>
            </li>
        </ul>
    </div>

</header>
<div class="Sidebar" id="sidebar">
    <ul class="menu">
        <li class="menu-item">
            <div lay-on="url" href="/" class="title">
                <div class="img img_box">
                    <img class="img1" src="/static/merchant/images/nav22.png">
                    <img class="img2" src="/static/merchant/images/nav21.png">
                </div>
                <span>商品管理</span>
                <!-- <i class="layui-icon layui-icon-right"></i> -->
            </div>
        </li>
        <li class="menu-item <?php if($routers == 'order/list' || $routers == 'order/shop_back' || $routers == 'order/review'): ?>  active <?php endif; ?>">
            <div class="title">
                <div class="img img_box">
                    <img class="img1" src="/static/merchant/images/nav32.png">
                    <img class="img2" src="/static/merchant/images/nav31.png">
                </div>
                <span>订单管理</span>
                <i class="layui-icon layui-icon-right"></i>
            </div>
            <dl    <?php if($routers == 'order/list' || $routers == 'order/shop_back' || $routers == 'order/review'): ?>  style="display: block;" <?php else: ?> style="display:none;" <?php endif; ?> >
                <dd>
                    <a href="/merchant/order.html"  <?php if($routers == 'order/list'): ?>  class="active" <?php endif; ?> >订单管理</a>
                </dd>
                <dd>
                    <a href="/merchant/shop_back.html" <?php if($routers == 'order/shop_back'): ?>  class="active" <?php endif; ?>>退货管理</a>
                </dd>
                <dd>
                    <a href="/merchant/review.html" <?php if($routers == 'order/review'): ?>  class="active" <?php endif; ?>>订单评价</a>
                </dd>

            </dl>

        </li>
        <li class="menu-item <?php if($routers == 'finance/finance_cash' || $routers == 'finance/finance_account' || $routers == 'finance/finance_log' || $routers == 'finance/finance_logs'): ?>  active <?php endif; ?>">
            <div class="title">
                <div class="img img_box">
                    <img class="img1" src="/static/merchant/images/nav42.png">
                    <img class="img2" src="/static/merchant/images/nav41.png">
                </div>
                <span>财务提现</span>
                <i class="layui-icon layui-icon-right"></i>
            </div>

            <dl  <?php if($routers == 'finance/finance_cash' || $routers == 'finance/finance_account' || $routers == 'finance/finance_log' || $routers == 'finance/finance_logs'): ?>  style="display: block;" <?php else: ?> style="display:none;" <?php endif; ?>>
                <dd>
                    <a  <?php if($routers == 'finance/finance_cash'): ?>  class="active" <?php endif; ?> href="/merchant/finance_cash.html">提现</a>
                </dd>
                <dd>
                    <a  <?php if($routers == 'finance/finance_logs'): ?>  class="active" <?php endif; ?> href="/merchant/finance_logs.html">记录</a>
                </dd>
            </dl>

        </li>
        <!-- <li class="menu-item ">
            <div class="title">
                <div class="img img_box">
                    <img class="img1" src="images/nav52.png">
                    <img class="img2" src="images/nav51.png">
                </div>
                <span>消息中心</span>
                <i class="layui-icon layui-icon-right"></i>
            </div>

        </li> -->
        <li class="menu-item <?php if($routers == 'store/store_info' || $routers == 'store/store_notice' || $routers == 'store/store_model'): ?>  active <?php endif; ?>">
            <div class="title">
                <div class="img img_box">
                    <img class="img1" src="/static/merchant/images/nav62.png">
                    <img class="img2" src="/static/merchant/images/nav61.png">
                </div>
                <span>店铺设置</span>
                <i class="layui-icon layui-icon-right"></i>
            </div>

            <dl <?php if($routers == 'store/store_info' || $routers == 'store/store_notice' || $routers == 'store/store_model'): ?>  style="display: block;" <?php else: ?> style="display:none;" <?php endif; ?>>
                <dd>
                    <a  <?php if($routers == 'store/store_info'): ?>  class="active" <?php endif; ?> href="/merchant/store_info.html">店铺信息 </a>
                </dd>
                <dd>
                    <a <?php if($routers == 'store/store_notice'): ?>  class="active" <?php endif; ?> href="/merchant/store_notice.html">店铺公告</a>
                </dd>
                <dd>
                    <a <?php if($routers == 'store/store_model'): ?>  class="active" <?php endif; ?>  href="/merchant/store_model.html">运费模板</a>
                </dd>
            </dl>

        </li>
    </ul>
</div>
		 
<div class="Content" id="content">
    <div class="container">
        <div class="FormPage StoreInfo">
            <form class="layui-form" lay-filter="storeForm">
                <div class="form-item-inline">
                    <label class="form-label">店铺头像：</label>
                    <div class="input-inline" style="display: flex;flex-direction: column;">
                        <button type="button" class="layui-btn" id="ID-upload-demo-btn">
                            <i class="layui-icon layui-icon-upload"></i> 单图片上传
                          </button>
                          <div style="width: 132px;">
                            <div class="layui-upload-list">
                              <img class="layui-upload-img" id="ID-upload-demo-img" src="<?php echo htmlentities((string) $merchant['shop_thumb']); ?>" style="width: 100%; height: 92px;">
                              <div id="ID-upload-demo-text"></div>
                            </div>
                            <div class="layui-progress layui-progress-big" lay-showPercent="yes" lay-filter="filter-demo">
                              <div class="layui-progress-bar" lay-percent=""></div>
                            </div>
                          </div>
                          <input type="hidden" name="shop_thumb" id="shop_thumb" value="">
                    </div>
                </div>
                <div class="form-item-inline">
                    <label class="must form-label">店铺名称：</label>

                    <div class="input-inline">
                        <input type="text" name="shop_name" placeholder="" lay-verify="required|maxlength"
                            lay-reqtext="" maxLength="50" class="layui-input" value="<?php echo htmlentities((string) $merchant['shop_name']); ?>">

                    </div>
                </div>

                <div class="form-item-inline" style="align-items: flex-start;">
                    <label class=" form-label">店铺简介：</label>
                    <div class="block">
                        <textarea name="shop_info" placeholder="" lay-verify="maxlength" maxlength="500"
                            class="layui-textarea"><?php echo htmlentities((string) $merchant['shop_info']); ?></textarea>

                    </div>

                </div>
                <div class="form-item-inline">
                    <label class="must form-label">电话：</label>

                    <div class="block">
                        <input type="text" name="phone" placeholder=""  lay-verify="required|maxlength"
                            lay-reqtext="" maxLength="50" class="layui-input" value="<?php echo htmlentities((string) $merchant['phone']); ?>">

                    </div>
                </div>
                <div class="form-item-inline">
                    <label class="must form-label">邮箱：</label>

                    <div class="input-inline">
                        <input type="text" name="email" placeholder="" lay-verify="required|maxlength"
                            lay-reqtext="" maxLength="50" class="layui-input" value="<?php echo htmlentities((string) $merchant['email']); ?>">

                    </div>
                </div>
                <div class="form-item-inline ">
                    <label class=" form-label"></label>
                    <div class="input-inline foot">
                        <button class="layui-btn" lay-submit lay-filter="submitForm">保存设置</button>
                    </div>
                </div>
            </form>
            
        </div>
    </div>
</div>

	</main>
</body>
<script  src="/static/merchant/js/index.js"></script>
<script src="/static/merchant/js/base.js"></script>
 
<script>
    changeTitleName('店铺信息');
    
    layui.use(['form', 'upload', 'layer','element'], function(){
        var form = layui.form;
        var upload = layui.upload;
        var layer = layui.layer;
        var $ = layui.$;
        var element = layui.element;
        
        // 头像上传
        var uploadInst = upload.render({
            elem: '#ID-upload-demo-btn',
            url: '/merchant/upload_img', // 实际使用时改成您自己的上传接口即可。
            before: function(obj){
                // 预读本地文件示例，不支持ie8
                obj.preview(function(index, file, result){
                    $('#ID-upload-demo-img').attr('src', result); // 图片链接（base64）
                });
                
                element.progress('filter-demo', '0%'); // 进度条复位
                layer.msg('上传中', {icon: 16, time: 0});
            },
            done: function(res){
                // 若上传失败
                if(res.code !=200){
                    return layer.msg('上传失败');
                }
                // 上传成功
                $('#ID-upload-demo-img').attr('src', res.data.src);
                $('#ID-upload-demo-text').html(''); // 置空上传失败的状态
                $('#shop_thumb').val(res.data.src); // 将图片地址存入隐藏域
            },
            error: function(){
            // 请求异常回调
            },
            // 进度条
            progress: function(n, elem, e){
            element.progress('filter-demo', n + '%'); // 可配合 layui 进度条元素使用
            if(n == 100){
                layer.msg('上传完毕', {icon: 1});
            }
            }
        });
        form.on('submit(submitForm)', function(data){
            var loading = layer.load(2);
            
            $.ajax({
                url: '/merchant/save_store_info',
                type: 'POST',
                dataType: 'json',
                data: data.field,
                success: function(res){
                    layer.close(loading);
                    if(res.code == 200){
                        layer.msg('保存成功', {icon: 1});
                    }else{
                        layer.msg(res.msg || '保存失败', {icon: 2});
                    }
                },
                error: function(){
                    layer.close(loading);
                    layer.msg('网络错误，请稍后再试', {icon: 2});
                }
            });
            
            return false; // 阻止表单自动提交
        });
        
        // 表单验证
        form.verify({
            phone: [/^1[3-9]\d{9}$|^(0\d{2,3}-?)?\d{7,8}$/, '请输入正确的电话号码'],
            email: [/^[a-z0-9._%-]+@([a-z0-9-]+\.)+[a-z]{2,4}$|^1[3-9]\d{9}$/i, '请输入正确的邮箱'],
            avatar: function(value){
                if(!value){
                    return '请上传店铺头像';
                }
            }
        });
        

    });
</script>
>
</html>